package net.scribblemedia.candle.mlengine;

import org.encog.mathutil.rbf.RBFEnum;
import org.encog.ml.data.MLDataSet;
import org.encog.ml.data.basic.BasicMLDataSet;
import org.encog.neural.rbf.RBFNetwork;
import org.encog.util.simple.EncogUtility;

public class XORTest {

	  public static double XOR_INPUT[][] = { { 0.0, 0.0 }, { 1.0, 0.0 },
				{ 0.0, 1.0 }, { 1.0, 1.0 } };

	  public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 1.0 }, { 0.0 } };
	 
	 
	  public static void main(String[] args) {
	    RBFNetwork method = new RBFNetwork(2,4,1,RBFEnum.Gaussian);
	    MLDataSet dataSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
	    EncogUtility.trainToError(method, dataSet, 0.01);
	    EncogUtility.evaluate(method, dataSet);
	  }
}
